package com.wc.blue_bridge_history.Java14C.B_分糖果;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/3/28 9:26
 * @description https://www.lanqiao.cn/paper/3873/problem/2928/
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 1000010;
    static int[] le = new int[128];
    static char[] s;
    static int n, x;

    // 这里每个人分糖果，bXXX 永远大于aXXX
    // 所以如果前面 1 ~ x的糖果相同，那就直接输出最后一个人的糖果，剩下的都是第一个人的了，这样差值最小
    // 1 ~ n 都相同，那就每个人一起分
    // 1 != x,那就说明第x人分完第x块，他就是最大了，与第一条同理
    public static void main(String[] args) {
        n = sc.nextInt();
        x = sc.nextInt();
        s = sc.next().toCharArray();
        Arrays.sort(s);
        if (s[0] == s[n - 1]) {
            int r = n / x + (n % x > 0 ? 1 : 0);
            for (int i = 0; i < r; i++) out.print(s[i]);
        } else if (s[0] == s[x - 1]) {
            // 最后一个人分了所有
            for (int i = x - 1; i < n; i++) out.print(s[i]);
        } else {
            // 第x个人分的第x块
            out.print(s[x - 1]);
        }
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
